﻿using System;
using System.Linq;
using Freshbooks.Client.Demo.Properties;
using Freshbooks.Model;

namespace Freshbooks.Client.Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            FreshbooksApi b = new FreshbooksApi(new Uri(Settings.Default.URL), Settings.Default.TOKEN);
            var languages = b.Language.ListLanguage();
            if (languages.Any())
                foreach (Language language in languages)
                {
                    Console.WriteLine("{0} {1}", language.Code, language.Name);
                }

            var categories = b.Category.GetCategories();
            if (categories != null)
                if (categories.Total > 0 && categories.List.Any())
                    foreach (Category category in categories.List)
                    {
                        Console.WriteLine("{0} {1}", category.CategoryId, category.Name);
                    }
        }
    }
}
